package com.leftheart.mapper;

import com.leftheart.entity.Books;
import com.leftheart.entity.User;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.springframework.stereotype.Repository;

import java.util.Date;
import java.util.List;

@Mapper
@Repository
public interface UserMapper {
    //增加用户
    int addUser(@Param("userName")String userName,@Param("userPwd") String userPwd,long accounts);
    //删除一个用户
    int deleteUserById(int userId);

    int getAccounts(User user);
    //更新用户
    int updateUser(User user);
    //通过ID查询用户

    User queryUserById(@Param("userId") int userId);
    //查询全部用户
    List<User> queryAllUser();
    //通过名字查询用户
    User queryUserByName(@Param("userName")String userName);

}
